//
//  NKTileOverlay.m
//  NKMapTest
//
//  Created by SongGang on 2017/3/30.
//  Copyright © 2017年 NK. All rights reserved.
//

#import "NKTileOverlay.h"

@interface NKTileOverlay()
@property NSCache *cache;
@property NSOperationQueue *operationQueue;
@end

@implementation NKTileOverlay

//- (NSURL *)URLForTilePath:(MATileOverlayPath)path {
//
////    return [NSURL URLWithString:[NSString stringWithFormat:@"https://c.tile.thunderforest.com/landscape/{z}/{%ld}/{%ld}.png?apikey=813808e22af5488cabc07d692f2fd21c",path.x,path.y]];
//    return [NSURL URLWithString: @"https://c.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=813808e22af5488cabc07d692f2fd21c"];
//
//}
//
//- (void)loadTileAtPath:(MATileOverlayPath)path
//                result:(void (^)(NSData *data, NSError *error))result
//{
//    if (!result) {
//        return;
//    }
//    
//    NSData *cachedData = [self.cache objectForKey:[self URLForTilePath:path]];
//    if (cachedData) {
//        result(cachedData, nil);
//    } else {
//        NSURLRequest *request = [NSURLRequest requestWithURL:[self URLForTilePath:path]];
//        [NSURLConnection sendAsynchronousRequest:request queue:self.operationQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
//            result(data, connectionError);
//        }];
//    }
//}

@end
